home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C & C++ Multimedia Cyber Classroom
/
C and C++ Multimedia Cyber Classroom (Prentice Hall) (1998).iso
/
src
/
fig10_01.jar
/
Ch10
/
Fig10_01
/
Boss1.cpp
next >
Wrap
C/C++ Source or Header
|
1997-10-28
|
594b
|
24 lines
// Fig. 10.1: boss1.cpp
// Member function definitions for class Boss
#include "boss1.h"
// Constructor function for class Boss
Boss::Boss( const char *first, const char *last, double s )
: Employee( first, last ) // call base-class constructor
{ setWeeklySalary( s ); }
// Set the Boss's salary
void Boss::setWeeklySalary( double s )
{ weeklySalary = s > 0 ? s : 0; }
// Get the Boss's pay
double Boss::earnings() const { return weeklySalary; }
// Print the Boss's name
void Boss::print() const
{
cout << "\n Boss: ";
Employee::print();
}